
package com.ehualu.liaocheng.config;

import com.ehualu.liaocheng.until.LoadPropertiesFile;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ProFileConfig {

    private static Logger log = LoggerFactory.getLogger(ProFileConfig.class);


    public static String driver = "";
    public static String jdbcurl = "";
    public static String username = "";
    public static String password = "";
    public static String YDZSjdbcurl = "";
    public static String YDZSusername = "";
    public static String YDZSpassword = "";


    public static String YDZStab = "";


    static {

        InputStream inPorp = Thread.currentThread().getContextClassLoader().getResourceAsStream("db.properties");
//        Properties prop = LoadPropertiesFile.loadPropertiesFile("/db.properties");
        Properties prop = new Properties();
        try {
            prop.load(inPorp);
        } catch (IOException e) {
            e.printStackTrace();
        }
        try {
//            properties.load(in);


            driver = prop.getProperty("driver");
            System.out.println("driver:" + driver);
            jdbcurl = prop.getProperty("jdbcurl");
            System.out.println("jdbcurl:" + jdbcurl);
            username = prop.getProperty("username");
            System.out.println("username:" + username);
            password = prop.getProperty("password");
            System.out.println("password:" + password);


            YDZSjdbcurl = prop.getProperty("YDZSjdbcurl");
            System.out.println("YDZSjdbcurl:" + YDZSjdbcurl);

            YDZSusername = prop.getProperty("YDZSusername");
            System.out.println("password:" + YDZSusername);
            YDZSpassword = prop.getProperty("YDZSpassword");
            System.out.println("YDZSpassword:" + YDZSpassword);


            YDZStab = prop.getProperty("YDZStab");
            System.out.println("YDZStab:" + YDZStab);

        } catch (Exception e) {
            log.error("获取配置失败");
        }
    }

}
